import java.util.Scanner;

public class Text_2 {
    public static void main(String[] args)  {
        System.out.println("*********************************");
        System.out.println("*****微型计算器               ****");
        System.out.println("*****1、求和                 ****");
        System.out.println("*****2、求差                 ****");
        System.out.println("*****3、求积                 ****");
        System.out.println("*****4、求商                 ****");
        System.out.println("*****5、求余                 ****");
        System.out.println("*****Q、退出                 ****");
        System.out.println("*****请选择您想执行的操作       ****");
        System.out.println("*********************************");
        Scanner scanner = new Scanner(System.in);
        String num = scanner.next();
        if (num == "Q") {
            System.out.println("程序结束");
        } else {
            System.out.println("请输入一个数字：");
            double a = scanner.nextDouble();
            System.out.println("请输入另一个数字：");
            double b = scanner.nextDouble();
            switch (num){
                case "1":
                    System.out.printf("%.2f",a + b);
                    break;
                case "2":
                    System.out.printf("%.2f",a - b);
                    break;
                case "3":
                    System.out.printf("%.2f",a * b);
                    break;
                case "4":
                    System.out.printf("%.2f",a / b);
                    break;
                case "5":
                    System.out.printf("%.2f",a % b);
                    break;
            }

        }
    }
}

